import Vue from 'vue'
import App from './App.vue'
import router from './router'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/style.less'
Vue.use(ElementUI)
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)

import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
  ak: 'RnOkG0M0NnKmMWq3jS6nQTn3fQ811YTt'
})
import { fabric } from 'fabric'
Vue.use(fabric)

import axios from 'axios'
Vue.prototype.$http = axios

import EZUIKit from 'ezuikit-js'
Vue.use(EZUIKit)

import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
Vue.use(VideoPlayer)

const hls = require('videojs-contrib-hls')
Vue.use(hls)

// 引入全局类
import common from '@/utils/common.js'
Vue.prototype.$common = common

Vue.config.productionTip = false
Vue.directive('allow', {
  bind: function(el, binding) {
    let permissionList = binding.value //在页面上绑定的 对应权限显示
    let permissionsArr = window.localStorage.getItem('permissionsArr') //获取的用户权限
    permissionsArr = JSON.parse(permissionsArr)
    el.style.display = 'none'
    for (let i = 0; i < permissionsArr.length; i++) {
      if (permissionList === permissionsArr[i]) {
        el.style.display = 'inline-block'
        break
      }
    }
  }
})
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
